]> dgit.raspbian.org Git - gnome-shell.git/commitdiff
calendar: Fix events for RTL locales
authorFlorian Müllner <fmuellner@gnome.org>
Fri, 20 Jun 2014 14:30:46 +0000 (16:30 +0200)
committerFlorian Müllner <fmuellner@gnome.org>
Tue, 24 Jun 2014 21:37:34 +0000 (23:37 +0200)
Unlike StTable, ClutterTableLayout does not take the actor's text
direction into account, so mirror columns ourselves now.

https://bugzilla.gnome.org/show_bug.cgi?id=731923

js/ui/calendar.js

index 5a387f149fc0f9a11b3cf40fbdd62f1393eddeb1..35e35e930bfd14ffbb015179f6b2e48eb90d4572 100644 (file)
@@ -734,8 +734,10 @@ const EventsList = new Lang.Class({
         dayLabel.clutter_text.line_wrap = false;
         dayLabel.clutter_text.ellipsize = false;
 
+        let rtl = this.actor.get_text_direction() == Clutter.TextDirection.RTL;
+
         let layout = this.actor.layout_manager;
-        layout.pack(dayLabel, 0, index);
+        layout.pack(dayLabel, rtl ? 2 : 0, index);
         layout.child_set(dayLabel, { x_expand: false,
                                      x_align: Clutter.TableAlignment.END,
                                      y_align: Clutter.TableAlignment.START });
@@ -756,7 +758,7 @@ const EventsList = new Lang.Class({
         titleLabel.clutter_text.line_wrap = true;
         titleLabel.clutter_text.ellipsize = false;
 
-        layout.pack(titleLabel, 2, index);
+        layout.pack(titleLabel, rtl ? 0 : 2, index);
         layout.child_set(titleLabel, { x_expand: true });
     },